/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Startegy;

import Pattern.SortDescent;
import Pattern.SortAscent;
import Pattern.NameList;
import Pattern.SortRandom;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author David
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Bienvenido");
        NameList lista = new NameList(new SortAscent());
        for (int i = 0; i < 5; i++) {
            System.out.println("Nombre " + (i + 1) + ": ");
            String nombre = leerNombre();
            lista.addName(nombre);
        }
        System.out.println("************");
        lista.printList();
        lista.printList(new SortDescent());
        lista.printList(new SortRandom());
    }

    private static String leerNombre() {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String s = null;
        try {
            s = reader.readLine();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return s;
    }
}
